#include "comm.h"
#include "interrupt.h"

//define  intetruppt's number
#define INT0 0
#define INT1 2


// interrupt 0 service function
void int0() interrupt INT0 {
    P0=0x00;
    delay(5000);
}


// interrupt 0 service function
void int1() interrupt INT1 {
    P0=0xFF;
    delay(5000);
}




void initInterrupt() {
//init interrupt 0
IT0=1;  //interrupt 0 is falling edge
EX0=1;  //enable interrupt 0
//EA=1;   //enable all interrupt

IT1=1;  //interrupt 1 is falling edge
EX1=1;  //enable interrupt 1
EA=1;

PX1=1;  //set interrupt 1 priority
PX0=0;  //set interrupt 0 priority


}

